<script>
 $(document).ready(function ()
    {
        $('#data').dataTable( {
            "sPaginationType": "full_numbers",
            //"bLengthChange": false,
            //"bInfo": false,
            "aaSorting": [[ 0, "desc" ]],
            //"bFilter": false
        });
    });
</script>
<fieldset>
	<div class="deliveries index">
		<h2><?php echo __('Receive Orders'); ?></h2>
		<div class="newbutton">
		<ul><li><?php echo $this->Html->link(__('Receive Orders'), array('action' => 'chooseorder')); ?></li></ul></div>
		<br/><br/>
		<table id="data" class="table" cellpadding="0" cellspacing="0">
		<thead>
		<tr>
				<th>Date Received</th>
				<th>Order Id</th>
				<th class="actions"><?php echo __('Actions'); ?></th>
		</tr>
		</thead>
		<tbody>
		<?php foreach ($deliveries as $delivery): ?>
		<tr>
			<td><?php echo h($delivery['Delivery']['created']); ?>&nbsp;</td>
			<td>
				<?php echo $this->Html->link($delivery['Orders']['id'], array('controller' => 'orders', 'action' => 'view', $delivery['Orders']['id'])); ?>
			</td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('action' => 'view', $delivery['Delivery']['id'])); ?>
				<?php //echo $this->Html->link(__('Edit'), array('action' => 'edit', $delivery['Delivery']['id'])); ?>
				<?php echo $this->Form->postLink(__('Archive'), array('action' => 'delete', $delivery['Delivery']['id']), null, __('Are you sure you want to archive # %s?', $delivery['Delivery']['id'])); ?>
			</td>
		</tr>
		<?php endforeach; ?>
		</tbody>
		</table>
	</div>
</fieldset>
